# -*- coding: utf-8 -*-

import sip
sip.setapi('QString', 2)
sip.setapi('QStringList', 2)
sip.setapi('QVariant', 2)

from PyQt4 import QtCore

#_______________________________________________________________________________
class CollectionTreeSortFilterView(QtCore.QObject):
    def __init__(self, ui):
        self.line_text = ui.collection_search_lineText
        self.header = ui.collection_view.header()
        self.button = ui.search_button
        self.collection = ui.collection_view
        self.button.toggled.connect(self.clear_line_text)

    def set_model(self, model):
        self.model = model
    
    def clear_line_text(self, checked):
        if not checked:
            self.line_text.clear()